export const state = () => ({
  locales: ['en_US', 'zh_CN'],
  locale: 'zh_CN',
  blogInfo :{},
  comments:0,
  tongji:{},
  sumArticleComments:0,
})

export const mutations = {
  // 此处为设置locale
  SET_LANG (state, locale) {
    if (state.locales.indexOf(locale) !== -1) {
      state.locale = locale
    }
  },
  SET_STORE_VALUE(state,payload){
    for (let key in payload) {
      if (state.hasOwnProperty(key)) {
        state[key] = payload[key]
      }
    }
  }
}

export const actions = {
  nuxtServerInit ({ commit }, { req }) {
    //console.log(req)
    // if (req.session.user) {
    //   commit('user', req.session.user)
    // }
  }
}
